🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / core / model / src / commonMain / kotlin / org / meshtastic / core / model / Capabilities.kt
Displaying Raw • Download
core/model/src/commonMain/kotlin/org/meshtastic/core/model/Capabilities.kt bf929c20f274232e0eb8ddc19b2dc82403e99e5b (bf929c20) Text, 4.73 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.model
Tff7b72import T7ee787org.meshtastic.core.model.util.isDebug
T8b949e/**
* Defines the capabilities and feature support based on the device firmware version.
*
* This class provides a centralized way to check if specific features are supported by the connected node's firmware.
* Add new features here to ensure consistency across the app.
*
* Note: Properties are calculated once during initialization for efficiency.
*/
Tff7b72data Tff7b72class T56d364CapabilitiesTb4b4b4(Tff7b72val Te6edf3firmwareVersionTb4b4b4: Tffa657String?Tb4b4b4, Tff7b72internal Tff7b72val Te6edf3forceEnableAllTb4b4b4: Tffa657Boolean Tff7b72= Te6edf3isDebugTb4b4b4) Tb4b4b4{
Tff7b72private Tff7b72val Te6edf3version Tff7b72= Te6edf3firmwareVersionTff7b72?.Te6edf3let Tb4b4b4{ Te6edf3DeviceVersionTb4b4b4(Tffa657itTb4b4b4) Tb4b4b4}
Tff7b72private Tff7b72fun Td2a8ffatLeastTb4b4b4(Te6edf3minTb4b4b4: Te6edf3DeviceVersionTb4b4b4)Tb4b4b4: Tffa657Boolean Tff7b72= Te6edf3forceEnableAll Tff7b72|Tff7b72| Tb4b4b4(Te6edf3version Tff7b72!Tff7b72= Tff7b72null Tff7b72&Tff7b72& Te6edf3version Tff7b72>Tff7b72= Te6edf3minTb4b4b4)
T8b949e/** Ability to mute notifications from specific nodes via admin messages. */
Tff7b72val Te6edf3canMuteNode Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_7_18Tb4b4b4)
T8b949e/** Ability to request neighbor information from other nodes. Gated to [UNRELEASED] until working reliably. */
Tff7b72val Te6edf3canRequestNeighborInfo Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3UNRELEASEDTb4b4b4)
T8b949e/** Ability to send verified shared contacts. Supported since firmware v2.7.12. */
Tff7b72val Te6edf3canSendVerifiedContacts Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_7_12Tb4b4b4)
T8b949e/** Ability to toggle device telemetry globally via module config. Supported since firmware v2.7.12. */
Tff7b72val Te6edf3canToggleTelemetryEnabled Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_7_12Tb4b4b4)
T8b949e/** Ability to toggle the 'is_unmessageable' flag in user config. Supported since firmware v2.6.9. */
Tff7b72val Te6edf3canToggleUnmessageable Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_6_9Tb4b4b4)
T8b949e/** Support for sharing contact information via QR codes. Supported since firmware v2.6.8. */
Tff7b72val Te6edf3supportsQrCodeSharing Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_6_8Tb4b4b4)
T8b949e/** Support for Status Message module. Supported since firmware v2.8.0. */
Tff7b72val Te6edf3supportsStatusMessage Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_8_0Tb4b4b4)
T8b949e/** Support for TAK (ATAK) module configuration. Supported since firmware v2.7.19. */
Tff7b72val Te6edf3supportsTakConfig Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_7_19Tb4b4b4)
T8b949e/**
* Support for the v2 TAK port (ATAK_PLUGIN_V2 = 78) with TAKPacketV2 + zstd dictionary compression. Supported since
* firmware v2.8.0. Firmware v2.7.x and earlier only support the legacy ATAK_PLUGIN port (72) with the original
* TAKPacket schema (PLI + GeoChat only, no compression), so the bridge falls back to that path for older nodes.
*/
Tff7b72val Te6edf3supportsTakV2 Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_8_0Tb4b4b4)
T8b949e/** Support for location sharing on secondary channels. Supported since firmware v2.6.10. */
Tff7b72val Te6edf3supportsSecondaryChannelLocation Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_6_10Tb4b4b4)
T8b949e/** Support for ESP32 Unified OTA. Supported since firmware v2.7.18. */
Tff7b72val Te6edf3supportsEsp32Ota Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_7_18Tb4b4b4)
T8b949e/**
* Support for the LoRa region→preset compatibility map and TINY presets. Supported since firmware v2.8.0. Older
* firmware never sends the map, so the UI keeps the preset list unconstrained and hides the new presets.
*/
Tff7b72val Te6edf3supportsLoraRegionPresetMap Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_8_0Tb4b4b4)
T8b949e/**
* Support for runtime lockdown mode (per-connection passphrase auth). Supported since firmware v2.8.0. Note:
* lockdown is also hardware-gated (nRF52 only) — the device advertises real support by sending a `LockdownStatus`,
* which is the authoritative signal and drives the actual UI state.
*/
Tff7b72val Te6edf3supportsLockdown Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_8_0Tb4b4b4)
T8b949e/**
* Support for the Mesh Beacon module (`ModuleConfig.MeshBeaconConfig` broadcast/listen). The proto is upstream but
* the firmware module traces to a community fork; gate the config editor to 2.8.0+ so older radios don't show a
* config they'd silently ignore.
*/
Tff7b72val Te6edf3supportsMeshBeacon Tff7b72= Te6edf3atLeastTb4b4b4(Te6edf3V2_8_0Tb4b4b4)
Tff7b72companion Tff7b72object Tb4b4b4{
Tff7b72private Tff7b72val Te6edf3V2_6_8 Tff7b72= Te6edf3DeviceVersionTb4b4b4(Ta5d6ff"Ta5d6ff2.6.8Ta5d6ff"Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3V2_6_9 Tff7b72= Te6edf3DeviceVersionTb4b4b4(Ta5d6ff"Ta5d6ff2.6.9Ta5d6ff"Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3V2_6_10 Tff7b72= Te6edf3DeviceVersionTb4b4b4(Ta5d6ff"Ta5d6ff2.6.10Ta5d6ff"Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3V2_7_12 Tff7b72= Te6edf3DeviceVersionTb4b4b4(Ta5d6ff"Ta5d6ff2.7.12Ta5d6ff"Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3V2_7_18 Tff7b72= Te6edf3DeviceVersionTb4b4b4(Ta5d6ff"Ta5d6ff2.7.18Ta5d6ff"Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3V2_7_19 Tff7b72= Te6edf3DeviceVersionTb4b4b4(Ta5d6ff"Ta5d6ff2.7.19Ta5d6ff"Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3V2_8_0 Tff7b72= Te6edf3DeviceVersionTb4b4b4(Ta5d6ff"Ta5d6ff2.8.0Ta5d6ff"Tb4b4b4)
Tff7b72private Tff7b72val Te6edf3UNRELEASED Tff7b72= Te6edf3DeviceVersionTb4b4b4(Ta5d6ff"Ta5d6ff9.9.9Ta5d6ff"Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.06s